<?php

class IndexController extends Zend_Controller_Action
{

    public function init()
    {
    	
    }

    public function indexAction()
    {
    	$this->view->title = 'Welcome';
    	
    	$auth = Zend_Auth::getInstance();
    	if ($auth->hasIdentity()) {
    		$firstName = $auth->getIdentity()->first_name;
    		
    		$this->view->title .= ', '. $firstName;
    		$this->view->firstName = $firstName;
    	}
    }

    public function menuAction()
    {
        $mainMenu = array(
    		array('title'=>'Home', 'controller' => 'index', 'action' => 'index'),
        	array('title'=>'Generate', 'controller' => 'url-gen', 'action' => 'index'),
        	array('title'=>'Users', 'controller' => 'user', 'action' => 'index'),
        	array('title'=>'History', 'controller' => 'url-gen', 'action' => 'history'),
    	);
        
        $this->view->menu = $mainMenu;
        $this->_helper->viewRenderer->setResponseSegment('menu');
    }


}



